using micromsg;
using MicroMsg.Common.Utils;
using MicroMsg.Protocol;
using System;
namespace MicroMsg.Scene
{
	public class NetSceneGetVUserInfo : NetSceneBaseEx<GetVUserInfoRequest, GetVUserInfoResponse, GetVUserInfoRequest.Builder>
	{
		private const string TAG = "NetSceneVGetUserInfo";
		public event onSceneFinishedDelegate mOnSceneFinished;
		public void doScene(uint version)
		{
			base.beginBuilder();
			this.mBuilder.BaseRequest = NetSceneBase.makeBaseRequest(0);
			this.mBuilder.Version = version;
			this.mSessionPack.mCmdID = 60;
			base.endBuilder();
		}
		protected override void onSuccess(GetVUserInfoRequest request, GetVUserInfoResponse response)
		{
			RetConst ret = (RetConst)response.BaseResponse.Ret;
			if (ret != RetConst.MM_OK)
			{
				Log.smethod_1("NetSceneVGetUserInfo", "Failed get VUser Info, ret = " + ret);
				if (this.mOnSceneFinished != null)
				{
					this.mOnSceneFinished(false, null);
				}
				return;
			}
			Log.smethod_4("NetSceneVGetUserInfo", "Finished to  get VUser Info, ret = " + ret);
			if (this.mOnSceneFinished != null)
			{
				this.mOnSceneFinished(true, response);
			}
		}
		protected override void onFailed(GetVUserInfoRequest request, GetVUserInfoResponse response)
		{
			Log.smethod_1("NetSceneVGetUserInfo", "Failed get VUser Info. ");
			if (this.mOnSceneFinished != null)
			{
				this.mOnSceneFinished(false, null);
			}
		}
	}
}
